package bb.lanxing.lib.devices.bici.model;

import bb.lanxing.lib.devices.bici.BiciDate;
import java.nio.ByteBuffer;
import java.text.SimpleDateFormat;

public class BiciWorkout {
    private short avgSpeed;
    private short calorise;
    private short count;
    private int distance;
    private int duration;
    private short elevationGain;
    private short elevationLoss;
    private int endCadence;
    private long endTime;
    private String endTimeString;
    private int endWheel;
    private short maxSpeed;
    private int originalDistance;
    private int originalDuration;
    private int pauseDuration;
    private short pauseTimes;
    private byte ridingStatus;
    private int startCadence;
    private long startTime;
    private String startTimeString;
    private int startWheel;
    private byte synchronize;

    public BiciWorkout(byte[] bArr) {
        ByteBuffer wrap = ByteBuffer.wrap(bArr);
        this.synchronize = wrap.get();
        this.ridingStatus = wrap.get();
        this.pauseTimes = wrap.getShort();
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        long biciDateToTimestamp = BiciDate.biciDateToTimestamp(wrap.getInt());
        this.startTime = biciDateToTimestamp;
        this.startTimeString = simpleDateFormat.format(biciDateToTimestamp);
        long biciDateToTimestamp2 = BiciDate.biciDateToTimestamp(wrap.getInt());
        this.endTime = biciDateToTimestamp2;
        this.endTimeString = simpleDateFormat.format(biciDateToTimestamp2);
        this.pauseDuration = wrap.getInt();
        this.originalDuration = wrap.getInt();
        this.originalDistance = wrap.getInt();
        this.maxSpeed = wrap.getShort();
        this.avgSpeed = wrap.getShort();
        this.elevationLoss = wrap.getShort();
        this.elevationGain = wrap.getShort();
        this.count = wrap.getShort();
        this.calorise = wrap.getShort();
        this.duration = wrap.getInt();
        this.distance = wrap.getInt();
        this.startCadence = wrap.getInt();
        this.endCadence = wrap.getInt();
        this.startWheel = wrap.getInt();
        this.endWheel = wrap.getInt();
    }

    public String toString() {
        return "\n synchronize = " + ((int) this.synchronize) + "\n ridingStatus = " + ((int) this.ridingStatus) + "\n startTime = " + this.startTime + " , " + this.startTimeString + "\n endTime = " + this.endTime + " , " + this.endTimeString + "\n pauseTimes = " + ((int) this.pauseTimes) + "\n pauseDuration = " + this.pauseDuration + "\n originalDuration = " + this.originalDuration + "\n originalDistance = " + this.originalDistance + "\n maxSpeed = " + ((int) this.maxSpeed) + "\n avgSpeed = " + ((int) this.avgSpeed) + "\n elevationLoss = " + ((int) this.elevationLoss) + "\n elevationGain = " + ((int) this.elevationGain) + "\n count = " + ((int) this.count) + "\n duration = " + this.duration + "\n distance = " + this.distance + "\n calorise = " + ((int) this.calorise) + "\n startCadence = " + this.startCadence + "\n endCadence = " + this.endCadence + "\n startWheel = " + this.startWheel + "\n endWheel = " + this.endWheel;
    }

    public byte getSynchronize() {
        return this.synchronize;
    }

    public void setSynchronize(byte b) {
        this.synchronize = b;
    }

    public byte getRidingStatus() {
        return this.ridingStatus;
    }

    public void setRidingStatus(byte b) {
        this.ridingStatus = b;
    }

    public long getStartTime() {
        return this.startTime;
    }

    public void setStartTime(long j) {
        this.startTime = j;
    }

    public String getStartTimeString() {
        return this.startTimeString;
    }

    public void setStartTimeString(String str) {
        this.startTimeString = str;
    }

    public long getEndTime() {
        return this.endTime;
    }

    public void setEndTime(long j) {
        this.endTime = j;
    }

    public String getEndTimeString() {
        return this.endTimeString;
    }

    public void setEndTimeString(String str) {
        this.endTimeString = str;
    }

    public short getPauseTimes() {
        return this.pauseTimes;
    }

    public void setPauseTimes(short s) {
        this.pauseTimes = s;
    }

    public int getPauseDuration() {
        return this.pauseDuration;
    }

    public void setPauseDuration(int i) {
        this.pauseDuration = i;
    }

    public int getOriginalDuration() {
        return this.originalDuration;
    }

    public void setOriginalDuration(int i) {
        this.originalDuration = i;
    }

    public int getOriginalDistance() {
        return this.originalDistance;
    }

    public void setOriginalDistance(int i) {
        this.originalDistance = i;
    }

    public short getMaxSpeed() {
        return this.maxSpeed;
    }

    public void setMaxSpeed(short s) {
        this.maxSpeed = s;
    }

    public short getAvgSpeed() {
        return this.avgSpeed;
    }

    public void setAvgSpeed(short s) {
        this.avgSpeed = s;
    }

    public short getElevationLoss() {
        return this.elevationLoss;
    }

    public void setElevationLoss(short s) {
        this.elevationLoss = s;
    }

    public short getElevationGain() {
        return this.elevationGain;
    }

    public void setElevationGain(short s) {
        this.elevationGain = s;
    }

    public short getCount() {
        return this.count;
    }

    public void setCount(short s) {
        this.count = s;
    }

    public int getDuration() {
        return this.duration;
    }

    public void setDuration(int i) {
        this.duration = i;
    }

    public int getDistance() {
        return this.distance;
    }

    public void setDistance(int i) {
        this.distance = i;
    }

    public short getCalorise() {
        return this.calorise;
    }

    public void setCalorise(short s) {
        this.calorise = s;
    }

    public int getStartCadence() {
        return this.startCadence;
    }

    public void setStartCadence(int i) {
        this.startCadence = i;
    }

    public int getEndCadence() {
        return this.endCadence;
    }

    public void setEndCadence(int i) {
        this.endCadence = i;
    }

    public int getStartWheel() {
        return this.startWheel;
    }

    public void setStartWheel(int i) {
        this.startWheel = i;
    }

    public int getEndWheel() {
        return this.endWheel;
    }

    public void setEndWheel(int i) {
        this.endWheel = i;
    }
}
